<template>
  <el-config-provider :locale="zhCn" :button="buttonConfig" :size="defaultSize">
    <router-view v-if="route.path === '/big-screen'"></router-view>
    <el-watermark
      v-else
      :font="{
        color: 'rgba(0, 0, 0, 0.06)',
      }"
      :content="['本系统为非涉密系统', '严禁处理、传输国家秘密']"
    >
      <Layout v-if="route.path !== '/' && route.path !== '/login'" />
      <router-view v-else class="login-body" v-slot="{ Component }">
        <transition name="el-fade-in">
          <keep-alive :max="5">
            <component :is="Component" />
          </keep-alive>
        </transition>
      </router-view>
    </el-watermark>
  </el-config-provider>
</template>

<script setup lang="ts">
import 'dayjs/locale/zh-cn'
import { dayjs } from 'element-plus'
import { zhCn } from 'element-plus/es/locale/index'
import { reactive } from 'vue'
import { useRoute } from 'vue-router'
import Layout from '@/components/layout/Layout.vue'

dayjs.locale('zh')

const defaultSize = 'default'

const buttonConfig = reactive({
  autoInsertSpace: true,
})

const route = useRoute()
</script>
<style scoped lang="scss"></style>
